<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>
    <script>
        function isNum(str) {
            if (str.length != 5) {
                return false;
            }
            if (str.length == 5) {
                var m1 = str[0];
                var m2 = str[1];
                var m3 = str[2];
                var m4 = str[3];
                var m5 = str[4];
                if (m1 == m2 == m3 && m4 == m5) {
                    return true;
                } else {
                    return false;
                }
            }
        }
        var str = prompt("请输入一个数：")
        alert(isNum(str));
    </script>


</body>

</html>